home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Telephone Manager / Stiletto Sources / ModuleSources / HSGetDTMF.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-11  |  2.1 KB  |  73 lines  |  [TEXT/MPS ]

  1. /************************************************************************************************/
  2. /*                                                                                                */
  3. /*    Module Name:    HSGetDTMF                                                                    */
  4. /*                                                                                                */
  5. /*    File Name:        HSGetDTMF.c                                                                    */
  6. /*                                                                                                */
  7. /*    © Apple Computer, Inc. 1994-1995                                                            */
  8. /*    All Rights Reserved                                                                            */
  9. /*                                                                                                */
  10. /*    Revision History:                                                                            */
  11. /*                                                                                                */
  12. /*        Date        Who                    Modification                                            */
  13. /*                                                                                                */
  14. /*        1994-07-29    Jaakko Railo        Original version                                        */
  15. /*                                                                                                */
  16. /************************************************************************************************/
  17.  
  18. /****************************************** DESCRIPTION ******************************************
  19.  
  20. *************************************************************************************************/
  21.  
  22. /******************************************** HEADERS *******************************************/
  23.  
  24. #ifndef __TELEPHONES__
  25. #include "Telephones.h"
  26. #endif
  27.  
  28. #include "TestModule.h"
  29.  
  30. /****************************************** DEFINITIONS *****************************************/
  31.  
  32. #define    kDTMFOn            1
  33. #define    kDTMFOff        0
  34.  
  35. /****************************************** PROTOTYPES ******************************************/
  36.  
  37. void     DoTest (CHRSPtr paramPtr);
  38.  
  39. /************************************************************************************************/
  40. /************************************************************************************************/
  41.  
  42.  
  43. pascal short TestModule (CHRSPtr paramPtr)
  44. {
  45.     short    returnValue = noErr;
  46.     
  47.     if (paramPtr->version <= kTestModuleVersion) {
  48.         
  49.         DoTest (paramPtr);
  50.         
  51.     }
  52.     else
  53.         returnValue = kWrongVersion;
  54.         
  55.     return (returnValue);
  56. }
  57.  
  58.  
  59. void DoTest (CHRSPtr paramPtr)
  60. {
  61.     TELHandle    termHand = GetCurrentTELHandle (paramPtr);
  62.     OSErr        errCode;
  63.     Boolean        dtmf;
  64.     
  65.     if ((errCode = TELHSGetDTMF (termHand, &dtmf)) == noErr)
  66.         Print (paramPtr, "TELHSGetDTMF --> DTMF = %s", 
  67.                 ((dtmf==kDTMFOn)?"DTMFOn":"DTMFOff"));
  68.     else
  69.         Print (paramPtr, "### TELHSGetDTMF failed : %d", errCode);
  70. }
  71.  
  72.  
  73.